/**
 * 
 */
package systole.domain.signals;

import java.io.Serializable;

/**
 * @author jmj
 *
 */
public class RawSignal implements Serializable {

    /**
     *
     */
    private static final long serialVersionUID = -3286972631816137444L;
    private Integer id;
    private boolean inverted = true;
    private Segment segment;

    /**
     *
     */
    public RawSignal() {
        super();
    }

    /**
     * @param id the id to set
     */
    public void setId(Integer id) {
        this.id = id;
    }

    /**
     * @return the id
     */
    public Integer getId() {
        return this.id;
    }

    /**
     * @param segment the segment to set
     */
    public void setSegment(Segment segment) {
        this.segment = segment;
    }

    /**
     * @return the segment
     */
    public Segment getSegment() {
        return this.segment;
    }

    /* (non-Javadoc)
     * @see java.lang.Object#hashCode()
     */
    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((this.id == null) ? 0 : this.id.hashCode());
        result = prime * result + ((this.segment == null) ? 0 : this.segment.hashCode());
        return result;
    }

    /* (non-Javadoc)
     * @see java.lang.Object#equals(java.lang.Object)
     */
    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        RawSignal other = (RawSignal) obj;
        if (this.id == null) {
            if (other.id != null) {
                return false;
            }
        } else if (!this.id.equals(other.id)) {
            return false;
        }
        if (this.segment == null) {
            if (other.segment != null) {
                return false;
            }
        } else if (!this.segment.equals(other.segment)) {
            return false;
        }
        return true;
    }

    /**
     * @return the inverted
     */
    public boolean isInverted() {
        return inverted;
    }

    /**
     * @param inverted the inverted to set
     */
    public void setInverted(boolean inverted) {
        this.inverted = inverted;
    }
}
